package com.renjiyue.dao;

import com.renjiyue.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test1 {
    @Test
    public void test2(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        UserMapper userDao = (UserMapper) context.getBean("userDao");
        for (User user : userDao.selectUser()) {
            System.out.println(user);
        }
    }
    @Test
    public void test3(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        UserMapper userDao = (UserMapper) context.getBean("userDao");
        for (User user : userDao.selectUser()) {
            System.out.println(user);
        }
    }
}
